;;; Copyright (C) 2022  Ivan Polyakov
;;;
;;; This file is part of fltube.
;;;
;;; fltube is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; fltube is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;   
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <https://www.gnu.org/licenses/>.


(use-modules (guix packages)
             (guix download)
             (guix git-download)
             (guix gexp)
             (guix build-system gnu)
             (gnu packages pkg-config)
             (gnu packages autotools)
             (gnu packages gettext)
             (gnu packages xorg)
             (gnu packages curl)
             (gnu packages javascript)
             (gnu packages fltk)
             (gnu packages video)
             (guix licenses))

(define %source-dir (dirname (current-filename)))

(define fltube
  (package
    (name "fltube")
    (version "git")
    (source (local-file %source-dir
                        #:recursive? #t
                        #:select? (git-predicate %source-dir)))
    (build-system gnu-build-system)
    (arguments
      '(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'autogen
            (lambda _ (zero? (system* "sh" "autogen.sh")))))))
    (native-inputs
      `(("pkg-config" ,pkg-config)
        ("autoconf" ,autoconf)
        ("automake" ,automake)
        ("gettext" ,gettext-minimal)))
    (inputs
      `(("libx11" ,libx11)
        ("libxext" ,libxext)
        ("libxfixes" ,libxfixes)
        ("libxft" ,libxft)
        ("cjson" ,cjson)
        ("curl" ,curl)
        ("fltk" ,fltk)
        ("mpv" ,mpv)))
    (home-page "http://notabug.org/vilor/fltube")
    (synopsis "Fast and ligthweight YouTube desktop player")
    (description "")
    (license gpl3+)))

fltube
